import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'

export default defineUniPages({
  globalStyle: {
    navigationStyle: 'default',
    navigationBarTitleText: 'unibest',
    navigationBarBackgroundColor: '#f8f8f8',
    navigationBarTextStyle: 'black',
    backgroundColor: '#FFFFFF',
  },
  easycom: {
    autoscan: true,
    custom: {
      '^wd-(.*)': 'wot-design-uni/components/wd-$1/wd-$1.vue',
      '^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)':
        'z-paging/components/z-paging$1/z-paging$1.vue',
      '^uni-(.*)': '@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue',
      '^liu-(.*)': '@/uni_modules/liu-$1.vue',
    },
  },
  tabBar: {
    color: '#999999',
    selectedColor: '#ac9dd4',
    backgroundColor: '#F8F8F8',
    borderStyle: 'black',
    height: '50px',
    fontSize: '10px',
    iconWidth: '24px',
    spacing: '3px',
    list: [
      {
        iconPath: 'static/tabbar/home.png',
        selectedIconPath: 'static/tabbar/homeHL.png',
        pagePath: 'pages/index/index',
        text: '首页',
      },
      {
        iconPath: 'static/tabbar/bookshelf.png',
        selectedIconPath: 'static/tabbar/bookshelfHL.png',
        pagePath: 'pages/bookshelf/bookshelf',
        text: '书架',
      },
      {
        iconPath: 'static/tabbar/personal.png',
        selectedIconPath: 'static/tabbar/personalHL.png',
        pagePath: 'pages/my/my',
        text: '我的',
      },
    ],
  },
  subPackages: [
    {
      root: 'pages-sub', // 子包得根目录
      pages: [
        // 页面路径和窗口表现
        {
          path: 'talkRecord',
          style: {
            navigationBarTitleText: '个人信息',
            navigationStyle: 'custom',
            // #ifdef MP-ALIPAY
            enablePullDownRefresh: false,
            'mp-alipay': {
              allowsBounceVertical: 'NO',
              transparentTitle: 'always',
              titlePenetrate: 'YES',
              defaultTitle: '',
            },
            // #endif
          },
        },
      ],
    },
  ],
  preloadRule: {
    'pages/my/my': {
      network: 'all',
      packages: ['pages-sub'],
    },
  },
})
